/*
 * @Author: lujiangbo knight_lujb@163.com
 * @Date: 2024-10-21 20:38:18
 * @LastEditors: lujiangbo knight_lujb@163.com
 * @LastEditTime: 2024-10-21 21:37:55
 * @Description: 
 */
import { defineStore } from "pinia";

export interface TokenDataProps {
    loginSessionId?: string;
    expires_at?: string;
    type?: string;
    sfUserId?: string;
}

export const useTokenStore = defineStore({
    id: 'tokenStore',
    state: () => ({
        tokenData: <TokenDataProps>{}
    }),
    actions: {
        setTokenData(data: TokenDataProps) {
            this.tokenData = { ...data }
        }
    },
    persist: {
        key: 'piniaTokenStore', //存储名称
        storage: sessionStorage, // 存储方式
    }
})